home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / programr / upc12bs1.zip / UUCICO / dcp.h < prev    next >
C/C++ Source or Header  |  1993-09-29  |  7KB  |  143 lines

  1. #ifndef DCP_H
  2. #define DCP_H
  3.  
  4. /*--------------------------------------------------------------------*/
  5. /*    d c p . h                                                       */
  6. /*                                                                    */
  7. /*    UUCICO main program definitions                                 */
  8. /*--------------------------------------------------------------------*/
  9.  
  10. /*--------------------------------------------------------------------*/
  11. /*    Copyright (C) Richard H. Lamb 1985, 1986, 1987                  */
  12. /*--------------------------------------------------------------------*/
  13.  
  14. /*--------------------------------------------------------------------*/
  15. /*    Changes Copyright (c) 1990-1993 by Kendra Electronic            */
  16. /*    Wonderworks.                                                    */
  17. /*                                                                    */
  18. /*    All rights reserved except those explicitly granted by the      */
  19. /*    UUPC/extended license agreement.                                */
  20. /*--------------------------------------------------------------------*/
  21.  
  22. /*--------------------------------------------------------------------*/
  23. /*                          RCS Information                           */
  24. /*--------------------------------------------------------------------*/
  25.  
  26. /*
  27.  *    $Id: dcp.h 1.9 1993/09/29 04:56:11 ahd Exp $
  28.  *
  29.  *    $Log: dcp.h $
  30.  * Revision 1.9  1993/09/29  04:56:11  ahd
  31.  * Suspend port by port name, not modem file name
  32.  *
  33.  * Revision 1.8  1993/09/27  00:50:57  ahd
  34.  * Control of serial port in passive mode by K. Rommel
  35.  *
  36.  * Revision 1.7  1993/09/21  01:43:46  ahd
  37.  * Move MAXPACK to commlib.h to allow use as standard comm buffer size
  38.  *
  39.  *      Mon May 15 19:54:43 1989 change portactive to port_active
  40.  *      Mon May 15 19:51:13 1989 Add portactive flag
  41.  *      19 Mar 1990  Add hostable.h header                           ahd
  42.  *
  43.  */
  44.  
  45. #define SMALL_PACKET 64       /* Max packet size most UUCP's can
  46.                                  handle                              */
  47. #ifndef RECV_BUF
  48. #define RECV_BUF (MAXPACK*8)  // 512 * 8 = 4096 = COMMFIFO buffer size
  49.                               // for DOS
  50. #endif
  51.  
  52. #define DCP_ERROR   10
  53. #define DCP_EMPTY   11
  54.  
  55. /*--------------------------------------------------------------------*/
  56. /*    Define high level state machine levels.  These levels define    */
  57. /*    processing during initialization, connection and                */
  58. /*    termination, but not during actual file transfers               */
  59. /*--------------------------------------------------------------------*/
  60.  
  61. typedef enum {
  62.       CONN_INITSTAT   = 'A',  /* Load host status file               */
  63.       CONN_INITIALIZE,        /* Select system to call, if any       */
  64.       CONN_CHECKTIME,         /* Check time to dial another          */
  65.       CONN_MODEM,             /* Load modem to process a system      */
  66.       CONN_DIALOUT,           /* Actually dial modem to system       */
  67.       CONN_HOTMODEM,          /* Initialize for a modem already
  68.                                  off-hook                            */
  69.       CONN_ANSWER,            /* Wait for phone to ring and user to
  70.                                  login                               */
  71.       CONN_LOGIN,             /* Modem is connected, do a login      */
  72.       CONN_HOTLOGIN,          /* Modem is connected, initialize user
  73.                                  from command line w/o login         */
  74.       CONN_PROTOCOL,          /* Exchange protocol information       */
  75.       CONN_SERVER,            /* Process files after dialing out     */
  76.       CONN_CLIENT,            /* Process files after being called    */
  77.       CONN_TERMINATE,         /* Terminate procotol                  */
  78.       CONN_DROPLINE,          /* Hangup the telephone                */
  79.       CONN_WAIT,              /* Wait until told to continue         */
  80.       CONN_EXIT }             /* Exit state machine loop             */
  81.       CONN_STATE ;
  82.  
  83. /*--------------------------------------------------------------------*/
  84. /*                        File transfer states                        */
  85. /*--------------------------------------------------------------------*/
  86.  
  87. typedef enum {
  88.       XFER_SENDINIT = 'a',    /* Initialize outgoing protocol        */
  89.       XFER_MASTER,            /* Begin master mode                   */
  90.       XFER_FILEDONE,          /* Receive or transmit is complete     */
  91.       XFER_NEXTJOB,           /* Look for work in local queue        */
  92.       XFER_REQUEST,           /* Process work in local queue         */
  93.       XFER_PUTFILE,           /* Send a file to remote host at our
  94.                                  request                             */
  95.       XFER_GETFILE,           /* Retrieve a file from a remote host
  96.                                  at our request                      */
  97.       XFER_SENDDATA,          /* Remote accepted our work, send data */
  98.       XFER_SENDEOF,           /* File xfer complete, send EOF        */
  99.       XFER_NOLOCAL,           /* No local work, remote have any?     */
  100.       XFER_SLAVE,             /* Begin slave mode                    */
  101.       XFER_RECVINIT,          /* Initialize Receive protocol         */
  102.       XFER_RECVHDR,           /* Receive header from other host      */
  103.       XFER_GIVEFILE,          /* Send a file to remote host at their
  104.                                  request                             */
  105.       XFER_TAKEFILE,          /* Retrieve a file from a remote host
  106.                                  at their request                    */
  107.       XFER_RECVDATA,          /* Receive file data from other host   */
  108.       XFER_RECVEOF,           /* Close file received from other host */
  109.       XFER_NOREMOTE,          /* No remote work, local have any?     */
  110.       XFER_LOST,              /* Lost the other host, flame out      */
  111.       XFER_ABORT,             /* Internal error, flame out           */
  112.       XFER_ENDP,              /* End the protocol                    */
  113.       XFER_EXIT               /* Return to caller                    */
  114.       } XFER_STATE ;
  115.  
  116. #define DCP_RETRY   (-2)
  117. #define DCP_FAILED  (-1)
  118. #define DCP_OK      0
  119.  
  120. typedef short   (*procref)();
  121.  
  122. extern size_t s_pktsize;        /* send packet size for this protocol   */
  123. extern size_t r_pktsize;        /* receive packet size for this protocol*/
  124. extern FILE *syslog;            /* syslog file pointer                  */
  125. extern char workfile[FILENAME_MAX];
  126.                                 /* name of current workfile             */
  127. extern FILE *fwork;             /* current work file pointer    */
  128. extern FILE *xfer_stream;       /* current disk file stream for file
  129.                                    being transfered                     */
  130. extern FILE *fsys;
  131.  
  132. extern char *Rmtname;           /* system we WANT to talk to    */
  133.  
  134. extern char rmtname[20];        /* system we end up talking to  */
  135.  
  136. extern struct HostTable *hostp;
  137. extern struct HostStats remote_stats;
  138.                                 /* host status, as defined by hostatus */
  139.  
  140. int    dcpmain(int  argc,char  * *argv);
  141.  
  142. #endif /* __DCP */
  143.